Repository navigation
Conversation
1. Root cause: drawMenuItemBackground() animation block did not check State_Enabled, causing highlight to be drawn on disabled items when the 150ms movement animation was still running from a previous hover 2. Fix: add State_Enabled early return before the animation block so disabled items skip animation highlight drawing entirely 3. Impact: disabled menu items no longer show highlight effect, behavior for enabled items is unchanged Log: fix disabled menu items showing highlight on hover Influence: 1. Test right-click menu with disabled items, verify no highlight on hover 2. Test moving mouse from enabled to disabled menu item during animation 3. Verify enabled menu items still show normal highlight and animation fix: 禁用态菜单项跳过高亮动画绘制 1. 根因:drawMenuItemBackground() 动画块未检查 State_Enabled,当 150ms 移动动画仍在运行时,高亮被绘制到禁用态菜单项上 2. 方案:在动画块前添加 State_Enabled early return,使禁用态菜单项 跳过动画高亮绘制 3. 影响:禁用态菜单项不再显示高亮效果,启用态菜单项行为不变 Log: 修复禁用态菜单项悬停时显示高亮效果的问题 Influence: 1. 测试含禁用项的右键菜单,验证悬停时无高亮 2. 测试动画运行期间从启用项移动到禁用项 3. 验证启用态菜单项仍显示正常高亮和动画 PMS: BUG-380835
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe fix adds an early return in drawMenuItemBackground() so disabled menu items skip the animation block and no longer receive transient hover highlights, including when the pointer moves from an enabled item during an active animation. Sequence diagram for skipping disabled menu item animationsequenceDiagram
participant Pointer
participant ChameleonStyle
participant Animation
participant MenuItem
Pointer->>ChameleonStyle: drawMenuItemBackground(option)
alt State_Enabled is absent
ChameleonStyle-->>MenuItem: return nullptr
Note over MenuItem: No transient highlight
else State_Enabled is present
ChameleonStyle->>Animation: isRuning()
Animation-->>ChameleonStyle: animation state
ChameleonStyle-->>MenuItem: Draw highlight or animation
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 6.7.53 |
|
TAG Bot New tag: 6.7.54 |
|
TAG Bot New tag: 6.7.55 |
|
treeland下的窗口工作区右键菜单应该是dtkdeclarative项目, |
修复 BUG-380835:窗口右键置灰选项,鼠标可选中且有高亮效果
问题描述
窗口标题栏右键菜单中,置灰(disabled)的菜单项(如「移至左边的工作区」)仍可被鼠标选中并显示高亮效果。期望行为是置灰选项不显示高亮。
根因
drawMenuItemBackground()函数中,selected变量在第 3140 行正确通过State_Enabled排除了禁用项,Block 1/2 正确处理。但动画块(Block 3,第 3190 行)无条件执行,不检查State_Enabled。当鼠标从 enabled 项移动到 disabled 项时,150ms 动画仍在运行,animation->isRuning()为 true,高亮被绘制到 disabled 项。修复方案
在动画块前添加
State_Enabledearly return,使 disabled 项跳过动画块,与 Block 1/2 的selected检查逻辑一致。改动内容
styleplugins/chameleon/chameleonstyle.cpp— 在动画块前添加 2 行State_Enabled检查(+4 行含空行)测试建议
PMS: BUG-380835
Summary by Sourcery
Bug Fixes: